<template>
  <div id="app">
    <!-- 头部一 -->
    <Headone></Headone>
    <router-view></router-view>
    <!-- 播放条 -->
    <PlayCon></PlayCon>
  </div>
</template>

<script>
import Headone from './components/fixed/top'
import PlayCon from './components/fixed/play'
import { mapState, mapMutations } from 'vuex'
export default {
  components: { Headone, PlayCon },
  created () {
    this.ishaveCookie()
  },
  computed: {
    ...mapState(['loginID', 'haslogin'])
  },
  methods: {
    ...mapMutations(['setLoginID', 'setHasLogin']),
    ishaveCookie () {
      if (document.cookie.length > 0) {
        this.setLoginID(5182204025)
        this.setHasLogin(true)
        // console.log('有cookie，无需登录')
      }
      else {
        this.setHasLogin(false)
      }
    }
  }
}
</script>

<style lang="less">
</style>
